<?php
/*Problem Domain
To Test the User class access object
*/
include_once '../UserDAOImpl.php';
include_once '../../model/User.php';

class TestUseDAOImpl extends PHPUnit_Framework_TestCase
{
	public function testUserDAOImplObject()
	{
		$dbobj = new UserDAOImpl();
		$conn = $dbobj->getConnection();
		$usr1 = new User("mohsin.sayyed@springcomputing.in", "******", "trainee"); 

		$dbobj->saveOrUpdate($usr1);

		$arr = $dbobj->listUsers();
		$lst = $arr->getArrayList();
		$this->assertEquals('mohsin.sayyed@springcomputing.in' , $lst[0]->getEmailId());
	}
}
?>
